package cc.linker.steplink.crm.merchanth5.controller.form;

import cc.linker.steplink.crm.commons.domain.WxUser;
import cc.linker.steplink.crm.commons.form.FormRequest;
import cc.linker.steplink.crm.commons.http.HttpService;
import cc.linker.steplink.crm.commons.model.FormLoginDto;
import cc.linker.steplink.crm.merchanth5.commons.FormFilter;
import cc.linker.steplink.crm.merchanth5.commons.RequestFilter;
import cc.linker.steplink.crm.merchanth5.pojo.form.ApplyFormDto;
import cc.linker.steplink.crm.merchanth5.pojo.form.CustomerRecordPo;
import cc.linker.steplink.crm.merchanth5.service.form.FormService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.beans.factory.annotation.Value;
import org.springframework.web.bind.annotation.*;

import javax.servlet.http.HttpServletRequest;
import java.util.List;
import java.util.Map;

/**
 * @Author: CKQ
 * @DateTime: 2020/8/11 8:51
 * @Description: TODO
 */
@RequestMapping("/h5/form")
@RestController
public class H5FormController {
    @Autowired
    private FormService formService;
    @Autowired
    private RequestFilter requestFilter;

//
//    /**
//     * @Description：获取我的报名
//     * @DateTime：2020/7/27 9:26
//     * @Params：
//     * @Return：
//     */
//    @GetMapping("/getCustomerRecord")
//    public List<CustomerRecordPo> getCustomerRecord(HttpServletRequest request,
//                                                    @RequestParam(value = "pageIndex", defaultValue = "1", required = false) Integer pageIndex,
//                                                    @RequestParam(value = "pageSize", defaultValue = "10", required = false) Integer pageSize) {
//        WxUser wxUser = requestFilter.getWxUser(request);
//        return formService.getCustomerRecord(wxUser,pageIndex,pageSize);
//    }

    /**
     * @Description：报名回调
     * @DateTime：2020/7/27 9:26
     * @Params：
     * @Return：
     */
    @PostMapping("/callback")
    public void callback(@RequestBody ApplyFormDto applyFormDto) {
         formService.insertCustomerLabel(applyFormDto);
    }


}
